//package com.yhh.zhongdian.view.activity;
//
//import android.content.ClipData;
//import android.content.ClipboardManager;
//import android.content.Context;
//import android.content.Intent;
//import android.content.pm.PackageManager;
//import android.net.Uri;
//import android.os.Bundle;
//import android.view.MenuItem;
//import android.widget.LinearLayout;
//import android.widget.Toast;
//
//import androidx.appcompat.app.ActionBar;
//import androidx.appcompat.widget.Toolbar;
//import androidx.cardview.widget.CardView;
//
//import com.yhh.basemvplib.impl.IPresenter;
//import com.yhh.zhongdian.MyApplication;
//import com.yhh.zhongdian.R;
//import com.yhh.zhongdian.base.MBaseActivity;
//import com.yhh.zhongdian.help.Donate;
//import com.yhh.zhongdian.utils.theme.ThemeStore;
//
//import butterknife.BindView;
//import butterknife.ButterKnife;
//
///**
// * Created by GKF on 2018/1/13.
// * 捐赠页面
// */
//
//public class DonateActivity extends MBaseActivity {
//    @BindView(R.id.toolbar)
//    Toolbar toolbar;
//    @BindView(R.id.cv_wx_gzh)
//    CardView cvWxGzh;
//    @BindView(R.id.vw_zfb_tz)
//    CardView vwZfbTz;
//    @BindView(R.id.vw_zfb_hb)
//    CardView vwZfbHb;
//    @BindView(R.id.vw_zfb_rwm)
//    CardView vwZfbRwm;
//    @BindView(R.id.vw_wx_rwm)
//    CardView vwWxRwm;
//    @BindView(R.id.ll_content)
//    LinearLayout llContent;
//    @BindView(R.id.vw_qq_rwm)
//    CardView vwQqRwm;
//    @BindView(R.id.vw_zfb_hb_ssm)
//    CardView vwZfbHbSsm;
//
//    public static void startThis(Context context) {
//        Intent intent = new Intent(context, DonateActivity.class);
//        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//        context.startActivity(intent);
//    }
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//    }
//
//    @Override
//    protected IPresenter initInjector() {
//        return null;
//    }
//
//    @Override
//    protected void onCreateActivity() {
//        getWindow().getDecorView().setBackgroundColor(ThemeStore.backgroundColor(this));
//        setContentView(R.layout.activity_donate);
//    }
//
//    @Override
//    protected void bindView() {
//        ButterKnife.bind(this);
//        this.setSupportActionBar(toolbar);
//        setupActionBar();
//    }
//
//    @Override
//    protected void initData() {
//
//    }
//
//    @Override
//    protected void bindEvent() {
//        vwZfbTz.setOnClickListener(view -> Donate.aliDonate(this));
//        cvWxGzh.setOnClickListener(view -> {
//            ClipboardManager clipboard = (ClipboardManager) this.getSystemService(Context.CLIPBOARD_SERVICE);
//            ClipData clipData = ClipData.newPlainText(null, "开源阅读软件");
//            if (clipboard != null) {
//                clipboard.setPrimaryClip(clipData);
//                toast(R.string.copy_complete);
//            }
//        });
//        vwZfbHb.setOnClickListener(view -> openActionViewIntent("https://gitee.com/gekunfei/Donate/raw/master/zfbhbrwm.png"));
//        vwZfbRwm.setOnClickListener(view -> openActionViewIntent("https://gitee.com/gekunfei/Donate/raw/master/zfbskrwm.jpg"));
//        vwWxRwm.setOnClickListener(view -> openActionViewIntent("https://gitee.com/gekunfei/Donate/raw/master/wxskrwm.jpg"));
//        vwQqRwm.setOnClickListener(view -> openActionViewIntent("https://gitee.com/gekunfei/Donate/raw/master/qqskrwm.jpg"));
//        vwZfbHbSsm.setOnClickListener(view -> getZfbHb(this));
//    }
//
//    public static void getZfbHb(Context context) {
//        ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
//        ClipData clipData = ClipData.newPlainText(null, "537954522");
//        if (clipboard != null) {
//            clipboard.setPrimaryClip(clipData);
//            Toast.makeText(context, "高级功能已开启\n红包码已复制\n支付宝首页搜索“537954522” 立即领红包", Toast.LENGTH_LONG).show();
//        }
//        try {
//            PackageManager packageManager = context.getApplicationContext().getPackageManager();
//            Intent intent = packageManager.getLaunchIntentForPackage("com.eg.android.AlipayGphone");
//            assert intent != null;
//            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//            context.startActivity(intent);
//        } catch (Exception e) {
//            e.printStackTrace();
//        } finally {
//            MyApplication.getInstance().upDonateHb();
//        }
//    }
//
//    private void openActionViewIntent(String address) {
//        try {
//            Intent intent = new Intent(Intent.ACTION_VIEW);
//            intent.setData(Uri.parse(address));
//            startActivity(intent);
//        } catch (Exception e) {
//            e.printStackTrace();
//            Toast.makeText(this, R.string.can_not_open, Toast.LENGTH_SHORT).show();
//        }
//    }
//
//    //设置ToolBar
//    private void setupActionBar() {
//        ActionBar actionBar = getSupportActionBar();
//        if (actionBar != null) {
//            actionBar.setDisplayHomeAsUpEnabled(true);
//            actionBar.setTitle(R.string.donate);
//        }
//    }
//
//    //菜单
//    @Override
//    public boolean onOptionsItemSelected(MenuItem item) {
//        int id = item.getItemId();
//        if (id == android.R.id.home) {
//            finish();
//        }
//        return super.onOptionsItemSelected(item);
//    }
//
//}
